home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / htdocs / xampp / mailsend.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  1.6 KB  |  62 lines

  1. <?php
  2.     include "langsettings.php";
  3. ?>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  5.     "http://www.w3.org/TR/html4/loose.dtd">
  6. <html>
  7.     <head>
  8.         <meta name="author" content="Kai Oswald Seidler, Kay Vogelgesang, Carsten Wiedmann">
  9.         <link href="xampp.css" rel="stylesheet" type="text/css">
  10.         <title></title>
  11.     </head>
  12.  
  13.     <body>
  14.          <p>
  15.         <h1><?php echo $TEXT['mail-sendnow']; ?></h1><p>
  16.         <table>
  17.             <tr>
  18.                 <td> <p>
  19.                     <?php
  20.                         if (empty($_POST['knownsender'])) {
  21.                             $_POST['knownsender'] = '';
  22.                         }
  23.                         if (empty($_POST['recipients'])) {
  24.                             $_POST['recipients'] = '';
  25.                         }
  26.                         if (empty($_POST['ccaddress'])) {
  27.                             $_POST['ccaddress'] = '';
  28.                         }
  29.                         if (empty($_POST['subject'])) {
  30.                             $_POST['subject'] = '';
  31.                         }
  32.                         if (empty($_POST['message'])) {
  33.                             $_POST['message'] = '';
  34.                         }
  35.                         $mailtos = $_POST['recipients'];
  36.                         $subject = $_POST['subject'];
  37.                         $message = $_POST['message'];
  38.  
  39.                         if (($_POST['ccaddress'] == "") || ($_POST['ccaddress'] == " ")) {
  40.                             $header = "From: $_POST[knownsender]";
  41.                         } else {
  42.                             $header .= "From: $_POST[knownsender]\r\n";
  43.                             $header .= " Cc: $_POST[ccaddress]";
  44.                         }
  45.  
  46.                         if (@mail($mailtos, $subject, $message, $header)) {
  47.                             echo "<i>".$TEXT['mail-sendok']."</i>";
  48.                         } else {
  49.                             echo "<i>".$TEXT['mail-sendnotok']."</i>";
  50.                         }
  51.                     ?>
  52.                 </td>
  53.             </tr>
  54.             <tr>
  55.                 <td> <p> <p> <p>
  56.                     <a href="javascript:history.back()">Zurⁿck zum Formular</a>
  57.                 </td>
  58.             </tr>
  59.         </table>
  60.     </body>
  61. </html>
  62.